import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

class Home_page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
     appBar: AppBar(
       //为false的时候会影响leading，actions、titile组件，导致向上偏移
       primary: true,
       //设置AppBar上面各种字体主题色
       textTheme: TextTheme(),
       actionsIconTheme: IconThemeData(color: Colors.black,opacity: 0.8),
       //设置AppBar上面Icon的主题颜色
       iconTheme: IconThemeData(color: Colors.black,opacity: 0.6),
       //设置导航条上面的状态栏显示字体颜色
       brightness: Brightness.dark,
       //设置背景颜色
       backgroundColor: Colors.white,
//          automaticallyImplyLeading: true,//在leading为null的时候失效
       centerTitle: true,
       title: Text('Greece'),
       leading: IconButton(
           icon: FaIcon(FontAwesomeIcons.rocketchat,),
           onPressed: (){
             print('点击了消息按钮');
           }
       ),
       actions:[
         IconButton(
             icon:
             FaIcon(FontAwesomeIcons.diagnoses),
             onPressed: (){
           print('点击了搜索按钮');
         }),
         IconButton(
             icon:
             FaIcon(FontAwesomeIcons.shippingFast),
             onPressed: (){
               print('点击了购物车按钮');
             }),
       ],
     ),
      body: HomeContent2(),
    );
  }
}


















class HomeContent2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var images = "http://114.116.241.147:9000/debv/%E7%90%BC%E6%81%A9%C2%B7%E9%9B%AA%E8%AF%BA.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=admin%2F20210122%2F%2Fs3%2Faws4_request&X-Amz-Date=20210122T142058Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=c843c9b30f624ec25dfdd77a759b9508a5fbed74f208c6baf0c689e99eeea3f7";
    return Center(
      child: Container(
        height: 800.0,
        width: 1200.0,

        //显示线上的图片
        child: Image.network(
          images,
          //图片在容器显示位置
          //topLeft 左上角
          //bottomLeft 左下角
          alignment: Alignment.topCenter,
          //颜色配置,需配合使用
          //color: Colors.redAccent,
          //colorBlendMode: BlendMode.color,
          fit: BoxFit.contain,
        ),

        decoration: BoxDecoration(
          color: Colors.blue,
        ),
      ),
    );
  }
}
